package com.qf.lanzhou.shop.api.controller;

import com.qf.lanzhou.shop.pojo.vo.BaseRespVO;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.ResponseBody;

import javax.servlet.http.HttpServletRequest;

/**
 * @Author jian
 * @Date 2021/1/14 11:08
 * @JDK 1.8
 * @Version 1.0
 */
@Api(tags = "监听器")
@Controller
public class GetMilistener extends BaseController{

    @ApiOperation(value = "监听器接口")
    @GetMapping("/listen")
    @ResponseBody
    public BaseRespVO getmylistener(HttpServletRequest req){
        int count = (int) req.getServletContext().getAttribute("count");
        System.out.println(count);
        return convertSuccessResult(count);
    }
}
